﻿using System;
using System.Runtime.CompilerServices;
using AutoR.Models;
using AutoR.Services;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using Prism.Services;

namespace AutoR.ViewModels.Tasks
{
	// Token: 0x0200007D RID: 125
	public class NodeConditionViewModel : BindableBase, INavigationAware, INavigatedAware, INavigatingAware
	{
		// Token: 0x17000072 RID: 114
		// (get) Token: 0x06000204 RID: 516 RVA: 0x000455CE File Offset: 0x000437CE
		private INavigationService NavigationService { get; }

		// Token: 0x17000073 RID: 115
		// (get) Token: 0x06000205 RID: 517 RVA: 0x000455D6 File Offset: 0x000437D6
		private IPageDialogService PageDialogService { get; }

		// Token: 0x17000074 RID: 116
		// (get) Token: 0x06000206 RID: 518 RVA: 0x000408F6 File Offset: 0x0003EAF6
		public GameData Game
		{
			get
			{
				return Runtime.Game;
			}
		}

		// Token: 0x17000075 RID: 117
		// (get) Token: 0x06000207 RID: 519 RVA: 0x000455DE File Offset: 0x000437DE
		// (set) Token: 0x06000208 RID: 520 RVA: 0x000455E8 File Offset: 0x000437E8
		public AttackNode Node
		{
			[CompilerGenerated]
			get
			{
				return this.<Node>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (object.Equals(this.<Node>k__BackingField, value))
				{
					return;
				}
				this.<Node>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Node);
			}
		}

		// Token: 0x17000076 RID: 118
		// (get) Token: 0x06000209 RID: 521 RVA: 0x00045618 File Offset: 0x00043818
		public DelegateCommand AddNodeCommand { get; }

		// Token: 0x17000077 RID: 119
		// (get) Token: 0x0600020A RID: 522 RVA: 0x00045620 File Offset: 0x00043820
		public DelegateCommand<NodeCondition> RemoveCommand { get; }

		// Token: 0x0600020B RID: 523 RVA: 0x00045628 File Offset: 0x00043828
		public NodeConditionViewModel(INavigationService navigationService, IPageDialogService pageDialogService)
		{
			this.NavigationService = navigationService;
			this.PageDialogService = pageDialogService;
			this.AddNodeCommand = new DelegateCommand(delegate()
			{
				this.Node.NodeCondition.Add(new NodeCondition());
			});
			this.RemoveCommand = new DelegateCommand<NodeCondition>(delegate(NodeCondition node)
			{
				this.Node.NodeCondition.Remove(node);
			});
		}

		// Token: 0x0600020C RID: 524 RVA: 0x0004067F File Offset: 0x0003E87F
		public void OnNavigatedFrom(INavigationParameters parameters)
		{
		}

		// Token: 0x0600020D RID: 525 RVA: 0x00045677 File Offset: 0x00043877
		public void OnNavigatedTo(INavigationParameters parameters)
		{
			if (parameters.ContainsKey("node"))
			{
				this.Node = (AttackNode)parameters["node"];
			}
		}

		// Token: 0x0600020E RID: 526 RVA: 0x0004067F File Offset: 0x0003E87F
		public void OnNavigatingTo(INavigationParameters parameters)
		{
		}
	}
}
